package com.label.Model.Query;

import com.baomidou.mybatisplus.annotation.TableField;
import com.label.Model.Common.Validation.Del;
import com.label.Model.Common.Validation.Get;
import com.label.Model.Common.Validation.Save;
import com.label.Model.Common.Validation.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.util.List;

@Data
@ApiModel(value = "账号信息")
public class UserQuery {

    @NotNull(message = "id不应为空",groups = {Update.class, Del.class, Get.class})
    private Long id;

    @NotBlank(message = "账号不为空",groups = {Save.class})
    @Size(min = 3,max = 20)
    @ApiModelProperty(value = "账户" , required = true)
    private String account;

    private String oldpassword;

    @Size(min = 3,max = 20)
    @ApiModelProperty(value = "密码" , required = true)
    @NotBlank(message = "密码不为空",groups = {Save.class})
    private String password;

    private String userName;

    private String unitId;

    private String schoolId;

    private String opLevel;

    private String phone;

    private String email;

    private String department;

    private String parentEmail;

    private String picPath;

    @NotEmpty(message = "角色不为空",groups = {Save.class})
    private List<Long> roles;

    public UserQuery(){}

    public UserQuery(String account) {
        this.account=account;
    }
}
